module.exports = {
  configureWebpack: {
    resolve: {
      // 配置别名
      alias: {
        assets: '@/assets',
        components: '@/components',
        network: '@/network',
        views: '@/views',
        common: '@/common'
      }
    }
  },
  devServer: {
    proxy: {
      '/api': {
        // 此处的写法，目的是为了 将 /api 替换成 http://123.56.158.121:8888
        target: 'http://123.56.158.121:8888', // 代理地址
        changeOrigin: true,
        ws: true,
        // 代理 配置允许post请求
        headers: {
          host: 'http://123.56.158.121:8888',
          origin: 'http://123.56.158.121:8888'
        },
        pathRewrite: {
          '^/api': '/'
        }
      }
    }
  }
}
